<template>
	<view class="review-game">
		<uni-section title="阵营胜利情况" type="line" class="gameresult-info" padding>
			<view class="tag-view">
				<uni-tag :text="gameProcessStatus" type="success" />
			</view>
		</uni-section>
<!-- 		<uni-section v-if="user.type==='dm'" v-for="(item,index) in gameStageActionList" :key="index" :title="item.gameStage" type="line"
			padding class="playeraction-info">
			<view class="action-text" v-for="(aciton,i) in item.playerAction" :key="i">{{aciton}}</view>
			<view class="control-btn">
				<button class="mini-btn " type="primary" size="mini"
					@click="viewVoteRecord(item.gameStage)">查看投票记录</button>
			</view>
		</uni-section> -->
		<uni-section  v-for="(item,key,index2) in stageInfoMap" :key="index2" :title="gameStageCodeTransList[key]" type="line"
			padding class="playeraction-info">
			<view class="action-text" v-for="(aciton,i) in item.actions" :key="i">{{aciton.actionSeatNumber}}&nbsp;{{actionsTrans[aciton.type]}}&nbsp;{{aciton.targetSeatNumber || ""}}</view>
			<view class="control-btn">
				<button class="mini-btn " type="primary" size="mini"
					@click="viewVoteRecord()">查看投票记录</button>
			</view>
		</uni-section>
	</view>
</template>

<script>
	import {mapState,mapGetters} from "@/store/helper/dm"
	export default {
		data() {
			return {
				actionsTrans:{
					'campaign_police':'竞选警长',
					'cupid_combine':'发动技能[爱心连接]' ,
					'exile_vote':'票出环节投' ,
					'exit_campaign_police':'退出警长竞选',
					'guarder_guard':'发动技能[守护]',
					'hunter_shoot':'发动技能[开枪]带走',
					'mvp_vote':'MVP投票选择',
					'werewolf_attack':'狼人袭击',
					'werewolf_boom':'自爆',
					'white_wolf_king_shoot':'发动技能[自爆]带走',
					'witch_poison': '发动技能[毒药]毒杀',
					'witch_rescue':'发动技能[解药]解救',
					'wolf_beauty_charm':'发动技能[魅惑]',
					'seer_check':'发动技能[查验]',
					'police_call_exile':'归票',
					'police_move':'将警徽移交至'
					},
				gameStageCodeTransList:{
					'first_night': "首夜",
					'police_election': "警长竞选",
					'day_1': "第一日",
					'night_1': "第一夜",
					'day_2': "第二日",
					'night_2': "第二夜",
					'day_3': "第三日",
					'night_3': "第三夜",
					'day_4': "第四日",
					'night_4': "第四夜",
					'day_5': "第五日",
					'night_5': "第五夜",
					'day_6': "第六日",
					'night_6': "第六夜",
					'day_7': "第七日",
					'night_7': "第七夜",
					'day_8': "第八日",
					'night_8': "第八夜",
					'day_9': "第九日",
					'night_9': "第九夜",
					'day_10': "第十日",
					'night_10': "第十夜",
				}	
			}
		},
		computed: {
			...mapState([
				"user",
				"gameStatus",
				"gamePlayers",
				"gameStageCode",
				"stageInfoMap",
				"gameStageActionList",
			]),
			...mapGetters([
				"gameProcessStatus"
			]),
		},
		methods: {
			viewVoteRecord(gameStage) {
				uni.navigateTo({
					url: `/pages/view/common/voterecode-history`
				})
			}
		},
	}
</script>

<style scoped lang="scss">
	.title {
		background-color: $uni-color-primary;
	}

	.tag-view {
		display:flex;
		margin: 10px;
	}

	.gameresult-info,
	.playeraction-info {
		background-color: #07C160;
		height: 100%;
	}

	.action-text {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: wrap;
		flex: 1;
		margin: 10px;
		color: $uni-text-color-placeholder;
		font-size: 14px;
	}

	.input {
		display: flex;
		align-items: center;
		height: 54.34rpx;
		width: 90.57rpx;
		margin: 0 5px;
		flex-wrap: wrap;
	}

	.control-btn {
		margin: 20px 10px;
	}
</style>
